<template>
  <!-- 请假信息 -->
  <div id="collectDetail">
    <el-form :model="form" label-width="100">
      <el-form-item label="请假人:">
        <p>{{ form.username }}</p>
      </el-form-item>
      <el-form-item label="开始时间:">
        <p>{{ form.startTime }}</p>
      </el-form-item>
      <el-form-item label="结束时间:">
        <p>{{ form.endTime }}</p>
      </el-form-item>
      <el-form-item label="时长:">
        <p>{{ form.duration }}小时</p>
      </el-form-item>
      <el-form-item label="事由:">
        <p>{{ form.cause }}</p>
      </el-form-item>
      <el-form-item label="附件:" style="width: 100%">
        <other-files ref="otherFiles" :files="form.otherFileList"></other-files>
      </el-form-item>
      <el-form-item label="类型:">
        <p>{{ form.leaveTypeName }}</p>
      </el-form-item>
      <el-form-item label="审批人:">
        <p>{{ form.toUsername }}</p>
      </el-form-item>
      <el-form-item label="申请时间:">
        <p>{{ form.createTime }}</p>
      </el-form-item>
      <el-form-item label="审核状态:" v-if="isReloadData" style="width: 100%">
        <p v-if="form.status == 0" style="color: #e6a23c">待审核</p>
        <p v-if="form.status == 1" style="color: #67c23a">通过</p>
        <p v-if="form.status == 2" style="color: #f56c6c">未通过</p>
        <p v-if="form.status == 3" style="color: #ff9b31">审核中</p>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import otherFiles from '@/components/otherFiles'
export default {
  name: 'collectDetail',
  data () {
    return {
      // form: {},
      isReloadData: true//局部刷新标识
    }
  },
  components: {
    otherFiles,
  },
  props: {
    form: {
      type: Object,
      required: true,
      default: () => {
        return {}
      }
    }
  },
  methods: {

    relodPart () {
      this.isReloadData = false
      this.$nextTick(() => {
        this.isReloadData = true
      })
    }
  }
}
</script>
<style lang='scss' scoped>
</style>